
def LongitudinalDiameter(dayHandin):
    import datetime
    dayCur = datetime.datetime.now() - datetime.timedelta(days = 1)      # 获取当前时间
    dayBegin = datetime.datetime.strptime(dayHandin, '%Y-%m-%d')
    x = (dayCur - dayBegin).days

    y = 0.0002 * (x ** 3) - 0.031 * (x ** 2) + 1.927 * x + 7.081

    return y

def TransverseDiameter(dayHandin):
    import datetime
    dayCur = datetime.datetime.now() - datetime.timedelta(days = 1)      # 获取当前时间
    dayBegin = datetime.datetime.strptime(dayHandin, '%Y-%m-%d')
    x = (dayCur - dayBegin).days

    y = 0.0000717 * (x ** 3) - 0.014 * (x ** 2) + 0.934 * x + 2.882

    return y

def LateralDiameter(dayHandin):
    import datetime
    dayCur = datetime.datetime.now() - datetime.timedelta(days = 1)      # 获取当前时间
    dayBegin = datetime.datetime.strptime(dayHandin, '%Y-%m-%d')
    x = (dayCur - dayBegin).days

    y = 0.000069 * (x ** 3) - 0.013 * (x ** 2) + 0.837 * x + 2.94

    return y


x1 = LongitudinalDiameter('2022-1-15')
print(x1)

x1 = TransverseDiameter('2022-1-15')
print(x1)

x1 = LateralDiameter('2022-1-15')
print(x1)